<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>章节管理 - 智慧题库</title>
    <link href="../assets/css/tailwind.css" rel="stylesheet">
    <link href="../assets/css/font-awesome.min.css" rel="stylesheet">
</head>
<body class="font-inter bg-gray-50 min-h-screen flex flex-col bg-education">
    <!-- 背景装饰元素 -->
    <div class="absolute inset-0 overflow-hidden -z-10">
        <div class="absolute top-10 left-10 w-40 h-40 rounded-full bg-primary/10 animate-float">
            <div class="w-full h-full flex items-center justify-center text-primary/20 text-6xl education-icon">
                <i class="fa fa-book"></i>
            </div>
        </div>
        <div class="absolute bottom-20 right-20 w-60 h-60 rounded-full bg-secondary/10 animate-float" style="animation-delay: -2s">
            <div class="w-full h-full flex items-center justify-center text-secondary/20 text-7xl education-icon">
                <i class="fa fa-graduation-cap"></i>
            </div>
        </div>
        <div class="absolute top-1/3 right-1/4 w-32 h-32 rounded-full bg-accent/10 animate-float" style="animation-delay: -4s">
            <div class="w-full h-full flex items-center justify-center text-accent/20 text-5xl education-icon">
                <i class="fa fa-lightbulb-o"></i>
            </div>
        </div>
        <div class="absolute bottom-1/3 left-1/3 w-28 h-28 rounded-full bg-primary/10 animate-float" style="animation-delay: -1s">
            <div class="w-full h-full flex items-center justify-center text-primary/20 text-4xl education-icon">
                <i class="fa fa-pencil-square-o"></i>
            </div>
        </div>
    </div>

    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white/90 backdrop-blur-sm shadow-sm transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <div class="flex items-center space-x-2">
                <div class="w-10 h-10 bg-primary/10 rounded-xl flex items-center justify-center text-primary">
                    <i class="fa fa-question-circle"></i>
                </div>
                <h1 class="text-xl font-bold text-dark ml-0 md:ml-[-2rem]">智慧题库管理系统</h1>
            </div>
            
            <!-- 顶部导航 -->
            <div class="hidden md:flex items-center space-x-2">
                <a href="AdminDashboard.html" class="nav-item">
                    <i class="fa fa-home mr-2"></i> 控制面板
                </a>
                <a href="QuestionManagement.html" class="nav-item active">
                    <i class="fa fa-book mr-2"></i> 题库管理
                </a>
                <a href="ExamManagement.html" class="nav-item">
                    <i class="fa fa-graduation-cap mr-2"></i> 考试管理
                </a>
                <a href="TextbookVersionList.html" class="nav-item">
                    <i class="fa fa-archive mr-2"></i> 教材管理
                </a>
                <a href="StatisticsAnalysis.html" class="nav-item">
                    <i class="fa fa-bar-chart mr-2"></i> 数据分析
                </a>
                <a href="SystemSettings.html" class="nav-item">
                    <i class="fa fa-cog mr-2"></i> 系统设置
                </a>
            </div>
            
            <div class="flex items-center space-x-4">
                <button class="p-2 text-muted hover:text-primary transition-colors relative">
                    <i class="fa fa-bell"></i>
                    <span class="absolute top-1 right-1 w-2 h-2 bg-accent rounded-full"></span>
                </button>
                <div class="flex items-center space-x-2">
                    <img src="https://picsum.photos/id/64/40/40" alt="用户头像" class="w-8 h-8 rounded-full object-cover border-2 border-primary/20">
                    <span class="hidden md:inline text-sm font-medium text-dark">张老师</span>
                    <i class="fa fa-angle-down text-muted"></i>
                </div>
                <button class="md:hidden p-2 text-muted hover:text-primary transition-colors" id="mobile-menu-button">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 主内容区 -->
    <main class="flex-grow flex">
        <!-- 左侧导航栏 -->
        <aside id="sidebar" class="w-64 bg-sidebar-bg shadow-sidebar transition-all duration-300 h-[calc(100vh-64px)] sticky top-[64px] overflow-y-auto">
            <!-- 题库管理菜单 -->
            <div class="p-4 border-b border-gray-200">
                <h3 class="text-sm font-medium text-muted uppercase tracking-wider">题库管理</h3>
            </div>
            <div class="p-2">
                <a href="QuestionManagement.html" class="sidebar-item">
                    <i class="fa fa-list-alt"></i>
                    <span>题目列表</span>
                </a>
                <a href="QuestionAdd.html" class="sidebar-item">
                    <i class="fa fa-plus-circle"></i>
                    <span>添加题目</span>
                </a>
                <a href="QuestionCategory.html" class="sidebar-item">
                    <i class="fa fa-folder"></i>
                    <span>题目分类</span>
                </a>
                <a href="QuestionTags.html" class="sidebar-item">
                    <i class="fa fa-tags"></i>
                    <span>标签管理</span>
                </a>
                <a href="QuestionPending.html" class="sidebar-item">
                    <i class="fa fa-flag"></i>
                    <span>待审核题目</span>
                </a>
                <div class="sidebar-item active">
                    <i class="fa fa-sitemap"></i>
                    <span>章节管理</span>
                </div>
                <a href="KnowledgePointManagement.html" class="sidebar-item">
                    <i class="fa fa-lightbulb-o"></i>
                    <span>知识点管理</span>
                </a>
            </div>
        </aside>

        <!-- 内容区域 -->
        <div class="flex-grow p-6">
            <!-- 页面标题 -->
            <div class="mb-8">
                <div class="flex items-center justify-between">
                    <div>
                        <h2 class="text-[clamp(1.5rem,3vw,2rem)] font-bold text-dark">章节管理</h2>
                        <p class="text-muted mt-2">管理教材章节结构，包括章节和小结的创建与组织</p>
                    </div>
                    <div class="flex space-x-3">
                        <button class="px-4 py-2 bg-white border border-gray-300 text-dark rounded-lg shadow-sm hover:bg-gray-50 transition-colors">
                            <i class="fa fa-filter mr-2"></i>筛选
                        </button>
                        <button class="px-4 py-2 bg-primary text-white rounded-lg shadow-sm hover:bg-primary/90 transition-colors">
                            <i class="fa fa-plus mr-2"></i>添加章节
                        </button>
                    </div>
                </div>
            </div>

            <!-- 章节统计卡片 -->
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
                <div class="stat-card rounded-2xl p-6 card-hover">
                    <div class="flex items-start justify-between">
                        <div>
                            <p class="text-muted text-sm">总章节数</p>
                            <h3 class="text-3xl font-bold text-dark mt-1">156</h3>
                            <p class="text-accent text-sm mt-2 flex items-center">
                                <i class="fa fa-arrow-up mr-1"></i> 本月新增 12 章
                            </p>
                        </div>
                        <div class="w-12 h-12 bg-primary/10 rounded-xl flex items-center justify-center text-primary">
                            <i class="fa fa-sitemap text-xl"></i>
                        </div>
                    </div>
                </div>
                
                <div class="stat-card rounded-2xl p-6 card-hover">
                    <div class="flex items-start justify-between">
                        <div>
                            <p class="text-muted text-sm">小结数量</p>
                            <h3 class="text-3xl font-bold text-dark mt-1">324</h3>
                            <p class="text-accent text-sm mt-2 flex items-center">
                                <i class="fa fa-arrow-up mr-1"></i> 较上月增长 15%
                            </p>
                        </div>
                        <div class="w-12 h-12 bg-secondary/10 rounded-xl flex items-center justify-center text-secondary">
                            <i class="fa fa-list-ul text-xl"></i>
                        </div>
                    </div>
                </div>
                
                <div class="stat-card rounded-2xl p-6 card-hover">
                    <div class="flex items-start justify-between">
                        <div>
                            <p class="text-muted text-sm">关联题目</p>
                            <h3 class="text-3xl font-bold text-dark mt-1">1,847</h3>
                            <p class="text-accent text-sm mt-2 flex items-center">
                                <i class="fa fa-arrow-up mr-1"></i> 平均每章 11.8 题
                            </p>
                        </div>
                        <div class="w-12 h-12 bg-accent/10 rounded-xl flex items-center justify-center text-accent">
                            <i class="fa fa-question-circle text-xl"></i>
                        </div>
                    </div>
                </div>
                
                <div class="stat-card rounded-2xl p-6 card-hover">
                    <div class="flex items-start justify-between">
                        <div>
                            <p class="text-muted text-sm">覆盖学科</p>
                            <h3 class="text-3xl font-bold text-dark mt-1">8</h3>
                            <p class="text-accent text-sm mt-2 flex items-center">
                                <i class="fa fa-check mr-1"></i> 数学、语文、英语等
                            </p>
                        </div>
                        <div class="w-12 h-12 bg-success/10 rounded-xl flex items-center justify-center text-success">
                            <i class="fa fa-book text-xl"></i>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 章节管理主内容 -->
            <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
                <!-- 章节树形结构 -->
                <div class="lg:col-span-1 bg-white rounded-2xl shadow-card">
                    <div class="p-6 border-b border-gray-200">
                        <div class="flex items-center justify-between">
                            <h3 class="text-lg font-bold text-dark">章节结构</h3>
                            <div class="flex space-x-2">
                                <button class="p-2 text-muted hover:text-primary transition-colors">
                                    <i class="fa fa-expand"></i>
                                </button>
                                <button class="p-2 text-muted hover:text-primary transition-colors">
                                    <i class="fa fa-compress"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="p-4">
                        <div class="space-y-2">
                            <!-- 数学 -->
                            <div class="chapter-tree-item">
                                <div class="flex items-center justify-between p-3 bg-primary/5 rounded-lg">
                                    <div class="flex items-center space-x-2">
                                        <i class="fa fa-chevron-down text-primary"></i>
                                        <i class="fa fa-book text-primary"></i>
                                        <span class="font-medium text-dark">数学</span>
                                    </div>
                                    <span class="text-xs text-muted">12章</span>
                                </div>
                                <div class="ml-6 mt-2 space-y-1">
                                    <div class="flex items-center justify-between p-2 hover:bg-gray-50 rounded cursor-pointer">
                                        <div class="flex items-center space-x-2">
                                            <i class="fa fa-minus text-muted text-xs"></i>
                                            <span class="text-sm text-dark">第一章 集合与常用逻辑用语</span>
                                        </div>
                                        <span class="text-xs text-muted">3小结</span>
                                    </div>
                                    <div class="flex items-center justify-between p-2 hover:bg-gray-50 rounded cursor-pointer">
                                        <div class="flex items-center space-x-2">
                                            <i class="fa fa-minus text-muted text-xs"></i>
                                            <span class="text-sm text-dark">第二章 一元二次函数、方程和不等式</span>
                                        </div>
                                        <span class="text-xs text-muted">4小结</span>
                                    </div>
                                    <div class="flex items-center justify-between p-2 hover:bg-gray-50 rounded cursor-pointer">
                                        <div class="flex items-center space-x-2">
                                            <i class="fa fa-minus text-muted text-xs"></i>
                                            <span class="text-sm text-dark">第三章 函数的概念与性质</span>
                                        </div>
                                        <span class="text-xs text-muted">5小结</span>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- 语文 -->
                            <div class="chapter-tree-item">
                                <div class="flex items-center justify-between p-3 bg-secondary/5 rounded-lg">
                                    <div class="flex items-center space-x-2">
                                        <i class="fa fa-chevron-right text-secondary"></i>
                                        <i class="fa fa-book text-secondary"></i>
                                        <span class="font-medium text-dark">语文</span>
                                    </div>
                                    <span class="text-xs text-muted">8章</span>
                                </div>
                            </div>
                            
                            <!-- 英语 -->
                            <div class="chapter-tree-item">
                                <div class="flex items-center justify-between p-3 bg-accent/5 rounded-lg">
                                    <div class="flex items-center space-x-2">
                                        <i class="fa fa-chevron-right text-accent"></i>
                                        <i class="fa fa-book text-accent"></i>
                                        <span class="font-medium text-dark">英语</span>
                                    </div>
                                    <span class="text-xs text-muted">10章</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 章节列表 -->
                <div class="lg:col-span-2 bg-white rounded-2xl shadow-card">
                    <div class="p-6 border-b border-gray-200">
                        <div class="flex items-center justify-between">
                            <h3 class="text-lg font-bold text-dark">章节列表</h3>
                            <div class="flex space-x-2">
                                <button class="px-3 py-1 text-sm bg-primary/10 text-primary rounded-lg">
                                    <i class="fa fa-sort mr-1"></i>排序
                                </button>
                                <button class="px-3 py-1 text-sm bg-secondary/10 text-secondary rounded-lg">
                                    <i class="fa fa-filter mr-1"></i>筛选
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="overflow-x-auto">
                        <table class="min-w-full divide-y divide-gray-200">
                            <thead class="bg-gray-50">
                                <tr>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">章节名称</th>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">学科</th>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">小结数</th>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">关联题目</th>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">创建时间</th>
                                    <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
                                    <th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
                                </tr>
                            </thead>
                            <tbody class="bg-white divide-y divide-gray-200">
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <div class="w-8 h-8 bg-primary/10 rounded-lg flex items-center justify-center text-primary mr-3">
                                                <i class="fa fa-sitemap"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-dark">第一章 集合与常用逻辑用语</div>
                                                <div class="text-sm text-muted">数学 · 高一</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">数学</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">3</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">45</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">2023-09-15</td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">已完成</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button class="text-secondary hover:text-secondary/80 mr-3">
                                            <i class="fa fa-eye"></i>
                                        </button>
                                        <button class="text-red-500 hover:text-red-600">
                                            <i class="fa fa-trash"></i>
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <div class="w-8 h-8 bg-secondary/10 rounded-lg flex items-center justify-center text-secondary mr-3">
                                                <i class="fa fa-sitemap"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-dark">第二章 一元二次函数、方程和不等式</div>
                                                <div class="text-sm text-muted">数学 · 高一</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">数学</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">4</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">52</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">2023-09-20</td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">已完成</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button class="text-secondary hover:text-secondary/80 mr-3">
                                            <i class="fa fa-eye"></i>
                                        </button>
                                        <button class="text-red-500 hover:text-red-600">
                                            <i class="fa fa-trash"></i>
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <div class="w-8 h-8 bg-accent/10 rounded-lg flex items-center justify-center text-accent mr-3">
                                                <i class="fa fa-sitemap"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-dark">第三章 函数的概念与性质</div>
                                                <div class="text-sm text-muted">数学 · 高一</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">数学</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">5</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">68</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">2023-09-25</td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">编辑中</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button class="text-secondary hover:text-secondary/80 mr-3">
                                            <i class="fa fa-eye"></i>
                                        </button>
                                        <button class="text-red-500 hover:text-red-600">
                                            <i class="fa fa-trash"></i>
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <div class="w-8 h-8 bg-success/10 rounded-lg flex items-center justify-center text-success mr-3">
                                                <i class="fa fa-sitemap"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-dark">第四章 指数函数与对数函数</div>
                                                <div class="text-sm text-muted">数学 · 高一</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">数学</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">4</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">38</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">2023-10-05</td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">已完成</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button class="text-secondary hover:text-secondary/80 mr-3">
                                            <i class="fa fa-eye"></i>
                                        </button>
                                        <button class="text-red-500 hover:text-red-600">
                                            <i class="fa fa-trash"></i>
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <div class="w-8 h-8 bg-warning/10 rounded-lg flex items-center justify-center text-warning mr-3">
                                                <i class="fa fa-sitemap"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-dark">第五章 三角函数</div>
                                                <div class="text-sm text-muted">数学 · 高一</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">数学</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">6</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">72</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">2023-10-10</td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">进行中</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button class="text-secondary hover:text-secondary/80 mr-3">
                                            <i class="fa fa-eye"></i>
                                        </button>
                                        <button class="text-red-500 hover:text-red-600">
                                            <i class="fa fa-trash"></i>
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    
                    <!-- 分页 -->
                    <div class="flex items-center justify-between px-6 py-4 border-t border-gray-200">
                        <div class="text-sm text-muted">
                            显示 <span class="font-medium">1</span> 到 <span class="font-medium">5</span> 条，共 <span class="font-medium">156</span> 条
                        </div>
                        <div class="flex space-x-1">
                            <button class="px-3 py-1 rounded-lg border border-gray-300 text-muted hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed" disabled>
                                <i class="fa fa-angle-left"></i>
                            </button>
                            <button class="px-3 py-1 rounded-lg bg-primary text-white">1</button>
                            <button class="px-3 py-1 rounded-lg border border-gray-300 text-muted hover:bg-gray-50">2</button>
                            <button class="px-3 py-1 rounded-lg border border-gray-300 text-muted hover:bg-gray-50">3</button>
                            <button class="px-3 py-1 rounded-lg border border-gray-300 text-muted hover:bg-gray-50">4</button>
                            <button class="px-3 py-1 rounded-lg border border-gray-300 text-muted hover:bg-gray-50">5</button>
                            <button class="px-3 py-1 rounded-lg border border-gray-300 text-muted hover:bg-gray-50">
                                <i class="fa fa-angle-right"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
</div>

<!-- 引入公共样式和脚本 -->
<link rel="stylesheet" href="../css/admin-styles.css">
<script src="../js/admin-scripts.js"></script>